<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich" >
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>TODO supply a title</title>
        <script language="javascript">
            function updateCostItemName(code, name)
            {
                document.getElementById('emp:costcode').value = code;
                document.getElementById('emp:costname').value = name;
            }
            function showCostItem() {
                window.open("./page/pay/check/ecoList.jsf", "经济科目", "height=1024,width=800,toolbar=no,menubar=no,scrollbars=no");
            }
        </script>
        <style type="text/css">
            table.styleData{
                border-collapse:collapse;
            }
            table.styleData th{
                background-color:#e2e2e2;
                color:#000000;
                text-align:center;
                font-weight:normal;
                padding:2px 4px 2px 4px;
                margin:0;
            }
            table.styleData td{
                margin:0;
                padding:0;
                padding:2px 4px 2px 4px;
            }
            table.styleData input{
                width:96%;
                padding:2px 4px 2px 4px;
                margin:inherit;
                border:none;
                text-align: center;
            }

            table.voucherGrid{
                border:1px solid #e2e2e2;
                border-collapse:collapse;
            }
            table.voucherGrid td{
                border:1px solid #e2e2e2;
            }

            table.checkGrid{
                border:1px solid #e2e2e2;
                border-collapse:collapse;
            }
            table.checkGrid td{
                border:1px solid #e2e2e2;
            }
            table.feeGrid{
                border:1px solid #e2e2e2;
                border-collapse:collapse;
            }
            table.feeGrid td{
                border:1px solid #e2e2e2;
            }
            .demo_fieldset {
                margin : 20px;
                border : 1px solid #ACBECE;
            }

            .demo_legend {
                font-weight : bold;
                margin : 0px 10px 0px 18px;
                font-family: Verdana;
            }
            .inputstype{
                width: 175px !important;
            }
            .pic{
                margin-bottom: -4px;
                margin-right: -2px;
                border:none;
                width:20px;
                height:20px;
            }
            .col1{
                width:80px;
                vertical-align: top;
            }
        </style>
    </h:head>
    <h:body>
        <h:form id="emp">
            <rich:panel header="差旅费报销单" styleClass="content-hight">
                <rich:messages globalOnly="true"/>
                <h:panelGrid columns="2">
                    <h:outputLabel value="单据状态:"/>
                    <h:panelGroup>
                        <h:outputText value="审核通过"  rendered="#{tripaccount.exp.numberStatus == '2'}" style="color:blue"/>
                        <h:outputText value="退回修改"  rendered="#{tripaccount.exp.numberStatus == '3'}" style="color:red"/>
                        <h:outputText value="等待审核"  rendered="#{tripaccount.exp.numberStatus == '0'}" style="color:green"/>
                        <h:outputText value="支付成功"  rendered="#{tripaccount.exp.numberStatus == '4'}" style="color:blue"/>
                        <h:outputText value="支付完毕"  rendered="#{tripaccount.exp.numberStatus == '6'}" style="color:blue"/>
                    </h:panelGroup>
                </h:panelGrid>
                <rich:toolbar  itemSeparator="grida">
                    <rich:toolbarGroup>
                        <h:commandLink action="#{tripaccount.checkandRep}"
                                         onclick="return confirm('确定通过？');"
                                         disabled="#{tripaccount.exp.numberStatus != '0'}">
                            <h:graphicImage value="./images/check.png" styleClass="pic" title="通过" />
                        </h:commandLink>
                        <h:commandLink  action="#{tripaccount.back}"
                                        onclick="return confirm('确定退回？');"
                                        disabled="#{tripaccount.exp.numberStatus != '0'}">
                            <h:graphicImage value="./images/return.png" styleClass="pic" title="退回" />
                        </h:commandLink>
                        <h:commandLink  action="#{tripaccount.rescind}"
                                        disabled="#{tripaccount.exp.numberStatus != '2'}">
                            <h:graphicImage value="./images/chexiao.png" styleClass="pic" title="撤销" />
                        </h:commandLink>
                        <a4j:commandLink  render="emp" action="#{tripaccount.getFirst}"
                                          disabled="#{tripaccount.dis.first}">
                            <h:graphicImage value="./images/btn_page_first.gif" styleClass="pic" title="首张" />
                        </a4j:commandLink>
                        <a4j:commandLink  render="emp" action="#{tripaccount.previouse}"
                                          disabled="#{tripaccount.dis.previouse}">
                            <h:graphicImage value="./images/btn_page_up.gif" styleClass="pic" title="上张" />
                        </a4j:commandLink>
                        <a4j:commandLink  render="emp" action="#{tripaccount.next}"
                                          disabled="#{tripaccount.dis.next}">
                            <h:graphicImage value="./images/btn_page_down.gif" styleClass="pic" title="下张" />
                        </a4j:commandLink>
                        <a4j:commandLink  render="emp" action="#{tripaccount.getLast}"
                                          disabled="#{tripaccount.dis.last}">
                            <h:graphicImage value="./images/btn_page_end.gif" styleClass="pic" title="末张" />
                        </a4j:commandLink>
                        <h:commandLink   action="#{tripaccount.goback}" >
                            <h:graphicImage value="./images/goback.png" styleClass="pic" title="返回" />
                        </h:commandLink>
                    </rich:toolbarGroup>
                </rich:toolbar>
                <fieldset class="demo_fieldset">
                    <legend class="demo_legend">差旅费报销单</legend>
                    <h:panelGrid columns="6" cellpadding="0" width="100%" styleClass="voucherGrid">
                        <h:outputLabel value="单据编号:" />
                        <h:outputText  id="number" value="#{tripaccount.exp.number}"/>

                        <h:outputLabel value="单据日期:" />
                        <h:outputText value="#{tripaccount.exp.numDate}">
                            <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" locale="cn" />
                        </h:outputText>

                        <h:outputLabel value="预算项目:"  />
                        <h:outputText  id="projName" value="#{tripaccount.exp.project.finName}" />

                        <h:outputText  value="出差事由：" />
                        <h:outputText  value="#{tripaccount.exp.affair}"/>

                        <h:outputLabel value="费用承担部门:" />
                        <h:outputText  id="paydept" value="#{tripaccount.exp.payDept.name}"  />

                        <h:outputText  value="报销人:"   />
                        <h:outputText  value="#{tripaccount.exp.feePer.cpsn_name}" />

                        <h:outputLabel value="附件张数:"/>
                        <h:outputText value="#{tripaccount.exp.affixAmount}"/>

                        <h:outputLabel value="备注:"/>
                        <h:outputText  id="memo" value="#{tripaccount.exp.memo}"/>
                    </h:panelGrid>
                    <h:panelGrid columns="6" cellpadding="0" width="70%" >
                        <h:panelGroup>
                            <h:outputText value="出差天数：" />
                            <h:outputLabel value="日期:" />
                            <h:outputText value="#{tripaccount.exp.beginDate}" style="width:110px">
                                <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" locale="cn" />
                            </h:outputText>
                            至
                            <h:outputLabel value="日期:       " />
                            <h:outputText value="#{tripaccount.exp.endDate}" style="width:110px">
                                <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" locale="cn" />
                            </h:outputText>
                        </h:panelGroup>
                    </h:panelGrid>



                    <rich:toolbar width="100%" style=" text-align:  center;" >
                        <h:outputLabel value="交通费用明细信息"/>
                    </rich:toolbar>
                    <rich:dataTable  value="#{tripaccount.model}" var="item"  id="table" 
                                     style="width: 100%">                       
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText value="出发" />
                            </f:facet>
                            <h:outputText value="#{item.beginDate}">
                                <f:convertDateTime pattern="yyyy/MM/dd" timeZone="GMT+8" locale="cn" />
                            </h:outputText>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText value="到达" />
                            </f:facet>
                            <h:outputText value="#{item.endDate}">
                                <f:convertDateTime pattern="yyyy/MM/dd" timeZone="GMT+8" locale="cn" />
                            </h:outputText>
                        </rich:column>
                        <rich:column style=" text-align:  center;">
                            <f:facet name="header">
                                <h:outputText value="出发地点" />
                            </f:facet>
                            <h:outputText value="#{item.startLocation}" id="b" style="width:110px" />
                        </rich:column>
                        <rich:column style=" text-align:  center;">
                            <f:facet name="header">
                                <h:outputText value="到达地点" />
                            </f:facet>
                            <h:outputText value="#{item.targetLocation}" id="btarget" style="width:110px" />
                        </rich:column>
                        <rich:column style=" text-align:  center;">
                            <f:facet name="header">
                                <h:outputText value="交通类席别" />
                            </f:facet>
                            <h:outputText value="#{item.feeDesc}" id="c" style="width:40px" />
                        </rich:column>
                        <rich:column style=" text-align:  center;">
                            <f:facet name="header">
                                <h:outputText value="交通费金额"/>
                            </f:facet>
                            <h:outputText value="#{item.amount}" id="d" style="width:40px"  >
                                <f:convertNumber type="number" pattern="#,##0.00"/>
                            </h:outputText>
                        </rich:column>

                        <rich:column style=" text-align:  center;">
                            <f:facet name="header">
                                <h:outputText value="住宿天数" />
                            </f:facet>
                            <h:outputText value="#{item.travelDetail.hotelFee.quantity}" id="e"  style="width:40px" />
                        </rich:column>
                        <rich:column style=" text-align:  center;">
                            <f:facet name="header">
                                <h:outputText value="住宿金额" />
                            </f:facet>
                            <h:outputText value="#{item.travelDetail.hotelFee.amount}" id="f" style="width:40px"  >
                                <f:convertNumber type="number" pattern="#,##0.00"/>
                            </h:outputText>
                        </rich:column>

                        <rich:column style=" text-align:  center;">
                            <f:facet name="header">
                                <h:outputText value="出差补助天数" />
                            </f:facet>
                            <h:outputText value="#{item.travelDetail.travelGrantsFee.quantity}" id="g" style="width:40px" />
                        </rich:column>
                        <rich:column style=" text-align:  center;">
                            <f:facet name="header">
                                <h:outputText value="出差补助金额" />
                            </f:facet>
                            <h:outputText value="#{item.travelDetail.travelGrantsFee.amount}" id="h" style="width:40px" >
                                <f:convertNumber type="number" pattern="#,##0.00"/>
                            </h:outputText>
                        </rich:column>
                        <f:facet name="footer">
                            <rich:dataScroller renderIfSinglePage="false" maxPages="5" />
                        </f:facet>
                    </rich:dataTable>

                    <h:panelGrid columns="2"  columnClasses="left,right" style="width:100%;">
                        <h:panelGroup>
                            <h:panelGrid columns="4"  styleClass="feeGrid" style="text-align:left;width:470px;">
                                <h:outputText value="公杂费:" />
                                <h:outputText id="toffice" value="#{tripaccount.fee.officeFee.amount}" >
                                    <f:convertNumber type="number" pattern="#,##0.00"/>
                                </h:outputText>
                                <h:outputText value="订(退)票费:" />
                                <h:outputText id="orderTickets" value="#{tripaccount.fee.orderTicketFee.amount}" >
                                    <f:convertNumber type="number" pattern="#,##0.00"/>
                                </h:outputText>
                                <h:outputText value="市内交通费:" />
                                <h:outputText id="cityTracffic" value="#{tripaccount.fee.cityTracfficFee.amount}" >
                                    <f:convertNumber type="number" pattern="#,##0.00"/>
                                </h:outputText>
                                <h:outputText value="其他:" />
                                <h:outputText id="otherCost" value="#{tripaccount.fee.otherFee.amount}" >
                                    <f:convertNumber type="number" pattern="#,##0.00"/>
                                </h:outputText>
                                <h:outputText  value="费用总金额:"   />
                                <h:outputText  value="#{tripaccount.exp.total}" >
                                    <f:convertNumber type="number" pattern="#,##0.00"/>
                                </h:outputText>

                                <h:outputText  value="部门:"   />
                                <h:outputText  value="#{tripaccount.exp.dept.name}" />
                                <h:outputText  value="制单人:"   />
                                <h:outputText  value="#{tripaccount.exp.user.cpsn_name}" />

                            </h:panelGrid>
                        </h:panelGroup>

                        <h:panelGroup>
                            <div style="height:80px;width:270px;overflow: auto">
                                <rich:dataTable id="editTable" value="#{tripaccount.styleDetail}" var="std"
                                                styleClass="styleData"
                                                rowClasses="list-row-odd,list-row-even"
                                                headerClass="table-header" style=" width: 250px;" >
                                    <rich:column style=" text-align:  center; width: 100px;" >
                                        <f:facet name="header">
                                            <h:outputText value="支 付 方 式"/>
                                        </f:facet>
                                        <h:outputText value="#{std.name}"/>
                                    </rich:column>

                                    <rich:column style=" text-align:  center; ">
                                        <f:facet name="header">
                                            <h:outputText value="金额"/>
                                        </f:facet>
                                        <h:outputText value="#{std.amount}"  >
                                            <f:convertNumber type="number" pattern="#,##0.00"/>
                                        </h:outputText>
                                    </rich:column>
                                </rich:dataTable>
                            </div>
                            <h:outputText  value="支付合计金额:"   />
                            <h:outputText id="styleTotal" value="#{tripaccount.styleTotal}">
                                <f:convertNumber type="double" pattern="###,##0.00" />
                            </h:outputText>
                        </h:panelGroup>
                    </h:panelGrid>
                </fieldset>
                <fieldset class="demo_fieldset">
                    <legend class="demo_legend">差旅费报销单审核</legend>
                    <h:panelGrid columns="4" width="100%" border="0" id="auditorCheck" >
                        <h:outputLabel value="核定金额:"  />
                        <h:inputText  id="totalnew"   size="28" value="#{tripaccount.exp.checkaccount}"
                                      disabled="#{tripaccount.exp.numberStatus != '0'}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:inputText>

                        <h:outputText value="支出渠道:" />
                        <h:selectOneMenu  id="costType" value="#{tripaccount.exp.costTypes.code}"
                                          disabled="#{tripaccount.exp.numberStatus != '0'}" style=" width: 198px;" >
                            <f:selectItem itemValue=" " itemLabel="-请选择-"/>
                            <f:selectItems value="#{class.selectItemList}" />
                        </h:selectOneMenu>

                        <h:outputText value="预算来源："  />
                        <h:selectOneRadio   value="#{tripaccount.exp.budgetSource}"
                                            disabled="#{tripaccount.exp.numberStatus != '0'}" >
                            <f:selectItem itemLabel="当年预算" itemValue="当年预算"/>
                            <f:selectItem itemLabel="上年结余" itemValue="上年结余"/>
                        </h:selectOneRadio>

                        <h:outputText value="支出类别:" />
                        <h:selectOneRadio value="#{tripaccount.exp.costClass}"
                                          disabled="true">
                            <f:selectItem itemLabel="基本支出" itemValue="0"/>
                            <f:selectItem itemLabel="项目支出" itemValue="1"/>
                        </h:selectOneRadio>

                        <h:outputLabel value="经济分类:" />
                        <h:inputText  id="costname"   size="28"  value="#{tripaccount.exp.costitem.name}"
                                      disabled="#{tripaccount.exp.numberStatus != '0'}"      onclick="showCostItem()" />
                        <a4j:commandButton value="支付令:" render="emp" action="#{tripaccount.buildpaycode}"
                                           disabled="#{tripaccount.exp.numberStatus != '0'}">
                        </a4j:commandButton>
                        <h:inputText  id="paycode" size="28"  value="#{tripaccount.exp.paycode}"
                                      disabled="#{tripaccount.exp.numberStatus != '0'}"/>
                    </h:panelGrid>

                    <hr/>
                    <h:panelGrid columns="2" width="100%" columnClasses="col1,col2">
                        <h:outputLabel value="审核意见:"/>
                        <h:inputTextarea value="#{tripaccount.exp.checkInfo}" cols="100" disabled="#{tripaccount.exp.numberStatus != '0'}"/>
                    </h:panelGrid>
                    <hr/>
                    <h:panelGrid columns="4" width="100%" columnClasses="col1,col2,col1,col2">
                        <h:outputLabel value="审核人:" />
                        <h:outputText value="#{tripaccount.exp.auditor}"/>
                        <h:outputLabel value="审核日期:" />
                        <h:outputText value="#{tripaccount.exp.auditDate}">
                            <f:convertDateTime pattern="yyyy年MM月dd日"/>
                        </h:outputText>
                    </h:panelGrid>
                </fieldset>
            </rich:panel>
        </h:form>
    </h:body>
</html>
